package zjitc.net.utils.Dao;

import org.junit.Test;
import zjitc.net.utils.Student;


import java.util.List;

import static org.junit.Assert.*;

public class StudentDaoTest {

    @Test
    public void findall() throws Exception {
        StudentDao studentDao = new StudentDao();
        List list  = studentDao.findall();
        System.out.println(list);

    }
    @Test
    public void findbyid() throws Exception {
        StudentDao studentDao = new StudentDao();
        Student student= studentDao.findbyid(5);
        System.out.println(student);

    }
    @Test
    public void add() throws Exception {
        StudentDao studentDao=new StudentDao();
        Student student1=new Student(1,"大苏打",45,"男");
        studentDao.add(student1);
        List list  = studentDao.findall();
        System.out.println(list);

    }
    @Test
    public void modify() throws Exception {
        StudentDao studentDao=new StudentDao();
        Student student1=new Student(7,"旺仔",12,"男");
        studentDao.modify(student1);
        //
        List list  = studentDao.findall();
        System.out.println(list);

    }
    @Test
    public void del() throws Exception {
        StudentDao studentDao=new StudentDao();

        studentDao.del("李大锤");
        List list  = studentDao.findall();
        System.out.println(list);

    }
    @Test
    public void length(){
        StudentDao studentDao=new StudentDao();

        studentDao.length(1,new int[]{1,2,3,4,5,6,7,8});


    }
}